<%@ page import="com.jfinal.plugin.activerecord.Db" %>
<%@ page import="cn.szzsi.model.Member" %>
<%@ page import="com.jfinal.kit.StrKit" %>
<%@ page import="com.jfinal.plugin.activerecord.Record" %>
<%@ page import="java.util.List" %>
<%@ page import="com.jfinal.render.Render" %>
<%@ page import="com.jfinal.kit.JsonKit" %><%--
  Created by IntelliJ IDEA.
  User: weimin28
  Date: 2017/1/2
  Time: 下午4:26
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%
    String pid = request.getParameter("id");
    if(StrKit.notBlank(pid) && !pid.equals("0")){

        String sql = "select bb.addMoney,bb.level,bb.rate,bb.createDate,m.username from sys_user_balance_detail bb left join sys_member" +
                " m on bb.fromuid = m.id where bb.mid = '"+pid+"' and bb.type='0' order by bb.createDate desc";
        List<Record> lr = Db.find(sql);
        if(lr!=null && lr.size()>0)
            out.print(JsonKit.toJson(lr));
        else
            out.print("");
    }else{
        out.print("");
    }
    out.flush();
%>
